move linux CI from configure to qmake. (#613)
authortsteven4 <13596209+tsteven4@users.noreply.github.com>
Fri, 7 Aug 2020 18:55:09 +0000 (12:55 -0600)
committerGitHub <noreply@github.com>
Fri, 7 Aug 2020 18:55:09 +0000 (12:55 -0600)
- Add recipe for internal_styles.cc, xcsv_tokens.gperf, gui, unix-gui, toolinfo to GPSBabel.pro.
- Add support for text substitution in setup.iss and gbversion.h to GPSBabel.pro.
- fix qmake warnings from "qmake -Wall".
- split recipes for documents into scripts.
- shellcheck fixes for fixdoc, mkcapabilities.
- parallel build for coverage.
- add INSTALL file with build instructions.
- sort document targets into ones for general consumption (gpsbabel.html, gpsbabel.pdf) and one to support www.gpsbabel.org (now gpsbabel.org instead of index.html).

12 files changed:
GPSBabel.pro
INSTALL [new file with mode: 0644]
build_and_test
gbversion.h.qmake.in [new file with mode: 0644]
gui/setup.iss.in [changed mode: 0755->0644]
gui/setup.iss.qmake.in [new file with mode: 0644]
tools/fixdoc
tools/make_gpsbabel_html.sh [new file with mode: 0755]
tools/make_gpsbabel_org.sh [new file with mode: 0755]
tools/make_gpsbabel_pdf.sh [new file with mode: 0755]
tools/mkcapabilities
tools/travis_script_linux_coverage

index eab30a4bd07dd7f2bbb7944d9dcad41198967110..0c21620f803eada9a2fe9bdfb36cffeac98c173e 100644 (file)
@@ -25,8 +25,37 @@ CONFIG += link_pkgconfig
 
 TEMPLATE = app
 
+# use GB variable to express ownership intention and
+# avoid conflict with documented and undocumented qmake variables
+GB.VERSION_COMPONENTS = $$split(VERSION, .)
+GB.MAJOR = $$member(GB.VERSION_COMPONENTS, 0)
+GB.MINOR = $$member(GB.VERSION_COMPONENTS, 1)
+GB.MICRO = $$member(GB.VERSION_COMPONENTS, 2)
+# Increase GB.BUILD for a new release (why? Where is this ever used?)
+# A: it's used by win32/gpsbabel.rc which includes gbversion.h
+GB.BUILD = 31
+# GB.PACKAGE_RELEASE = "-beta20190413"
+
+# may be overwridden on qmake command line
+!defined(DOCVERSION, var) {
+  DOCVERSION=$${VERSION}
+}
+
+# may be overwridden on qmake command line
+!defined(WEB, var) {
+  WEB = ../babelweb
+}
+
+# use undocumented QMAKE_SUBSTITUTES variable to emulate AC_CONFIG_FILES
+GB.versionfile.input = gbversion.h.qmake.in
+GB.versionfile.output = gbversion.h
+QMAKE_SUBSTITUTES += GB.versionfile
+GB.setupfile.input = gui/setup.iss.qmake.in
+GB.setupfile.output = gui/setup.iss
+QMAKE_SUBSTITUTES += GB.setupfile
+
 MINIMAL_FMTS =  magproto.cc explorist_ini.cc gpx.cc geo.cc mapsend.cc garmin.cc \
-               garmin_device_xml.cc garmin_tables.cc internal_styles.cc nmea.cc \
+               garmin_device_xml.cc garmin_tables.cc nmea.cc \
                kml.cc wbt-200.cc
 
 ALL_FMTS=$$MINIMAL_FMTS gtm.cc gpsutil.cc pcx.cc \
@@ -61,7 +90,7 @@ FILTERS=position.cc radius.cc duplicate.cc arcdist.cc polygon.cc smplrout.cc \
         nukedata.cc interpolate.cc transform.cc height.cc swapdata.cc bend.cc \
         validate.cc
 FILTER_HEADERS = $$FILTERS
-FILTER_HEADERS ~= s/\.cc/.h/g
+FILTER_HEADERS ~= s/\\.cc/.h/g
 
 JEEPS += jeeps/gpsapp.cc jeeps/gpscom.cc \
          jeeps/gpsmath.cc jeeps/gpsmem.cc  \
@@ -161,6 +190,47 @@ HEADERS =  \
 
 HEADERS += $$FILTER_HEADERS
 
+win32-msvc* {
+  # avoid attempts by cmd.exe to execute mkstyle.sh
+  SOURCES += internal_styles.cc
+} else {
+  # It would be nice to do this when make runs instead of qmake, but we will
+  # monitor the style directory to catch new or deleted .style files.
+  STYLE_FILES = $$files($${PWD}/style/*.style)
+  # It's a bit tacky, but this may modify source files when doing an out of source build.
+  # The root of this is that internal_styles.cc is checked in as it can't be built on all platforms,
+  # and we want to make sure it is up to date on commit.
+  styles.commands += $${PWD}/mkstyle.sh > $${PWD}/internal_styles.cc || (rm -f $${PWD}/internal_styles.cc ; exit 1)
+  styles.CONFIG += combine no_clean
+  styles.depends += $${PWD}/mkstyle.sh
+  styles.depends += $${PWD}/style # this catches the creation/deletion of a style file.
+  styles.input = STYLE_FILES
+  styles.output = $${PWD}/internal_styles.cc
+  styles.variable_out = SOURCES
+  QMAKE_EXTRA_COMPILERS += styles
+}
+
+win32-msvc* {
+  # assume gperf not available.
+  HEADERS += xcsv_tokens.gperf
+} else {
+  TOKEN_FILES = $${PWD}/xcsv_tokens.in
+  equals(PWD, $${OUT_PWD}) {
+    tokens.commands += gperf --output-file=xcsv_tokens.gperf -L C++ -D -t xcsv_tokens.in
+  } else {
+    # Require in source builds.
+    # The the output must be checked in and the output depends on
+    # the --output-file parameter and the input file.
+    tokens.commands += echo "compilation of xcsv_tokens is not supported for out of source builds.";
+    tokens.commands += exit 1;
+  }
+  tokens.CONFIG += no_link no_clean
+  tokens.input = TOKEN_FILES
+  tokens.output = $${PWD}/xcsv_tokens.gperf
+  tokens.variable_out = HEADERS
+  QMAKE_EXTRA_COMPILERS += tokens
+}
+
 load(configure)
 
 CONFIG(release, debug|release): DEFINES *= NDEBUG
@@ -228,7 +298,7 @@ QMAKE_CLEAN += $${OUT_PWD}/testo.d/*.vglog
 # build the compilation data base used by clang tools including clang-tidy.
 macx|linux|openbsd{
   compile_command_database.target = compile_commands.json
-  compile_command_database.commands = make clean; bear make
+  compile_command_database.commands = $(MAKE) clean; bear $(MAKE)
   QMAKE_EXTRA_TARGETS += compile_command_database
 }
 
@@ -249,7 +319,7 @@ QMAKE_EXTRA_TARGETS += clang-tidy
 # dependencies:
 # extra ubuntu bionic packages: gcovr lcov
 linux{
-  coverage.commands = make clean;
+  coverage.commands = $(MAKE) clean;
   coverage.commands += rm -f gpsbabel_coverage.xml;
   coverage.commands += $(MAKE) CFLAGS=\"$(CFLAGS) -fprofile-arcs -ftest-coverage\" CXXFLAGS=\"$(CXXFLAGS) -fprofile-arcs -ftest-coverage\" LFLAGS=\"$(LFLAGS) --coverage\" &&
   coverage.commands += ./testo &&
@@ -263,28 +333,16 @@ linux{
 cppcheck.commands = cppcheck --enable=all --force --config-exclude=zlib --config-exclude=shapelib $(INCPATH) $$ALL_FMTS $$FILTERS $$SUPPORT $$JEEPS
 QMAKE_EXTRA_TARGETS += cppcheck
 
-!defined(WEB, var) {
-  WEB = ../babelweb
-}
-!defined(DOCVERSION, var) {
-  DOCVERSION=$${VERSION}
+gpsbabel.org.depends = gpsbabel gpsbabel.pdf FORCE
+equals(PWD, $${OUT_PWD}) {
+  gpsbabel.org.commands += web=\$\${WEB:-$${WEB}};
+  gpsbabel.org.commands += docversion=\$\${DOCVERSION:-$${DOCVERSION}};
+  gpsbabel.org.commands += tools/make_gpsbabel_org.sh \"\$\${web}\" \"\$\${docversion}\";
+} else {
+  gpsbabel.org.commands += echo "target gpsbabel.org is not supported for out of source builds.";
+  gpsbabel.org.commands += exit 1;
 }
-
-index.html.depends = gpsbabel FORCE
-index.html.commands += web=\$\${WEB:-$${WEB}} &&
-index.html.commands += docversion=\$\${DOCVERSION:-$${DOCVERSION}} &&
-index.html.commands += mkdir -p \$\${web}/htmldoc-\$\${docversion} &&
-index.html.commands += perl xmldoc/makedoc &&
-index.html.commands += xmlwf xmldoc/readme.xml &&  #check for well-formedness
-index.html.commands += xmllint --noout --valid xmldoc/readme.xml &&    #validate
-index.html.commands += xsltproc \
-  --stringparam base.dir "\$\${web}/htmldoc-\$\${docversion}/" \
-  --stringparam root.filename "index" \
-  xmldoc/babelmain.xsl \
-  xmldoc/readme.xml &&
-index.html.commands += tools/fixdoc \$\${web}/htmldoc-\$\${docversion} "GPSBabel \$\${docversion}:" &&
-index.html.commands += tools/mkcapabilities \$\${web} \$\${web}/htmldoc-\$\${docversion}
-QMAKE_EXTRA_TARGETS += index.html
+QMAKE_EXTRA_TARGETS += gpsbabel.org
 
 #
 # The gpsbabel.pdf target depends on additional tools.
@@ -307,28 +365,34 @@ QMAKE_EXTRA_TARGETS += index.html
 #
 
 gpsbabel.html.depends = gpsbabel FORCE
-gpsbabel.html.commands += perl xmldoc/makedoc &&
-gpsbabel.html.commands += xsltproc \
-   --output gpsbabel.html \
-   --stringparam toc.section.depth "1" \
-   --stringparam html.cleanup "1" \
-   --stringparam make.clean.html "1" \
-   --stringparam html.valid.html "1" \
-   --stringparam html.stylesheet \
-   "https://www.gpsbabel.org/style3.css" \
-   http://docbook.sourceforge.net/release/xsl/current/xhtml/docbook.xsl \
- xmldoc/readme.xml
+equals(PWD, $${OUT_PWD}) {
+  gpsbabel.html.commands += tools/make_gpsbabel_html.sh
+} else {
+  gpsbabel.html.commands += echo "target gpsbabel.html is not supported for out of source builds.";
+  gpsbabel.html.commands += exit 1;
+}
 QMAKE_EXTRA_TARGETS += gpsbabel.html
 
 gpsbabel.pdf.depends = gpsbabel FORCE
-gpsbabel.pdf.commands += web=\$\${WEB:-$${WEB}} &&
-gpsbabel.pdf.commands += docversion=\$\${DOCVERSION:-$${DOCVERSION}} &&
-gpsbabel.pdf.commands += perl xmldoc/makedoc && 
-gpsbabel.pdf.commands += xmlwf xmldoc/readme.xml && #check for well-formedness
-gpsbabel.pdf.commands += xmllint --noout --valid xmldoc/readme.xml &&   #validate
-gpsbabel.pdf.commands += xsltproc -o gpsbabel.fo xmldoc/babelpdf.xsl xmldoc/readme.xml &&
-gpsbabel.pdf.commands += HOME=. fop -q -fo gpsbabel.fo -pdf gpsbabel.pdf &&
-gpsbabel.pdf.commands += mkdir -p \$\${web}/htmldoc-\$\${docversion} &&
-gpsbabel.pdf.commands += cp gpsbabel.pdf \$\${web}/htmldoc-\$\${docversion}/gpsbabel-\$\${docversion}.pdf
+equals(PWD, $${OUT_PWD}) {
+  gpsbabel.pdf.commands += tools/make_gpsbabel_pdf.sh
+} else {
+  gpsbabel.pdf.commands += echo "target gpsbabel.pdf is not supported for out of source builds.";
+  gpsbabel.pdf.commands += exit 1;
+}
 QMAKE_EXTRA_TARGETS += gpsbabel.pdf
 
+gui.depends = $(TARGET) FORCE
+gui.commands += cd gui; $(QMAKE) app.pro && $(MAKE)
+QMAKE_EXTRA_TARGETS += gui
+
+unix-gui.depends = gui FORCE
+unix-gui.commands += cd gui; $(MAKE) package
+QMAKE_EXTRA_TARGETS += unix-gui
+
+toolinfo.depends = FORCE
+toolinfo.commands += $(CC) --version;
+toolinfo.commands += $(CXX) --version;
+toolinfo.commands += $(QMAKE) -v;
+QMAKE_EXTRA_TARGETS += toolinfo
+
diff --git a/INSTALL b/INSTALL
new file mode 100644 (file)
index 0000000..974c56d
--- /dev/null
+++ b/INSTALL
@@ -0,0 +1,64 @@
+The use of the autotools based build system (configure) is deprecated and may
+be removed in a future release!
+
+The use of cmake is experimental.  The implementation is not complete.  It is
+untested by continuous integration.  It is not recommended for production use.
+
+The recommended build uses Qt's qmake:
+
+The following options may be set on the qmake command line.
+
+WITH_LIBUSB=no|pkgconfig|system*|included*|custom
+  note that libusb is NOT used on windows.
+  no: build without libusb-1.0.  functionality will be limited.
+  pkgconfig: build with libusb-1.0 found by pkg-config.
+  system: build with libusb-1.0 found on system library path and under
+    libusb-1.0 on system include path (default, linux, openbsd).
+  included: build with libusb-1.0 included with gpsbabel (default, macOS only).
+  custom: build with user supplied libusb-1.0. LIBS and INCLUDEPATH may need to
+    be set, e.g. LIBS+=... INCLUDEPATH+=...
+
+WITH_SHAPELIB=no|pkgconfig|included*|custom
+  no: build without shapelib.  functionality will be limited.
+  pkgconfig: build with shapelib found by pkg-config.
+  included: build with shapelib included with gpsbabel (default).
+  custom: build with user supplied shapelib. LIBS and INCLUDEPATH may need to
+    be set, e.g. LIBS+=... INCLUDEPATH+=...
+
+WITH_ZLIB=no|pkgconfig|included*|custom
+  no: build without zlib.  functionality will be limited.
+  pkgconfig: build with zlib found by pkg-config.
+  included: build with zlib included with gpsbabel (default).
+  custom: build with user supplied zlib. LIBS and INCLUDEPATH may need to be
+    set, e.g. LIBS+=... INCLUDEPATH+=...
+
+DOCVERSION=...
+  string appended to documentation location for www.gpsbabel.org.  The default
+  value is the version string, e.g. "1.7.0".  This is used by the gpsbabel.org
+  target, you are unlikely to need it unless you are maintaining
+  www.gpsbabel.org.
+WEB=DIR
+  Path where the documentation will be stored for www.gpsbabel.org.  This is
+  used by the gpsbabel.org target, you are unlikely to need it unless you are
+  maintaining www.gpsbabel.org.  The default location is "../babelweb"
+  
+Make targets:
+
+check: Run the basic test suite.
+check-vtesto: Run valgrind memcheck.
+gpsbabel: Build the command line tool.
+gpsbabel.hmtl: Create the html documentation.
+gpsbabel.org: Create documentation for use on www.gpsbabel.org.
+gpsbabel.pdf: Create the pdf documentation.
+gui: Build the graphical user interface.
+unix-gui: Build the graphical user interface and collect the components for
+  distribution.  On Linux the gpsbabel generated components will be under
+  gui/GPSBabelFE, any dynamically linked required libraries are not included.
+  On macOS an app bundle will be created at gui/GPSBabelFE.app and an apple disk
+  image will be created at gui/GPSBabelFE.dmg.
+
+Windows builds:
+  Two build methods are supported with MSVC tools.
+  1. "qmake -tp vc" will create a visual studio project that can be built with msbuild.
+  2. "qmake" will create a Makefile that can be built with nmake.
+
index b2fe52478e4a1566b56affeb8200376977e79d15..64afebd070583f014b0161401df5083bf2ea6c9d 100755 (executable)
@@ -17,23 +17,22 @@ git --no-pager log -n 1
 # some of our targets are part of the svn repository to allow a
 # minimal set of build tools to be used.
 # touch these targets to make sure they aren't considered out of date.
-touch configure
 touch xcsv_tokens.gperf
 touch internal_styles.cc
 # build and test keeping output within the pwd.
 export GBTEMP=$(pwd)/gbtemp
 mkdir -p $GBTEMP
-./configure --with-doc=$(pwd)/gpsbabel_docdir
+qmake WEB=$(pwd)/gpsbabel_docdir
 # As of 2018-10, all the virtualized travis build images are two cores per:
 # https://docs.travis-ci.com/user/reference/overview/
 # We'll be slightly abusive on CPU knowing that I/O is virtualized.
-export MAKEFLAGS=-j3
 make toolinfo
 make clean
-make
-make linux-gui
-make doc
+make -j 3
+make -j 3 unix-gui
 make gpsbabel.html
+make gpsbabel.pdf
+make gpsbabel.org
 make check
 # test for mangled encoding of command line arguments
 ./test_encoding_latin1
diff --git a/gbversion.h.qmake.in b/gbversion.h.qmake.in
new file mode 100644 (file)
index 0000000..ead3c61
--- /dev/null
@@ -0,0 +1,17 @@
+/*
+ * gbversion.h is generated from gbversion.h.in which uses autoconf voodoo
+ * to get the version number from configure.ac.
+ *
+ * Isn\'t simplification via automation grand?
+ */
+#ifdef RC_INVOKED
+// These defines are for the Microsoft resource compiler scripts
+// win32/gpsbabel.rc and gui/app.rc
+#define VER_FILE $${GB.MAJOR},$${GB.MINOR},$${GB.MICRO},$${GB.BUILD}
+#define VER_PRODUCT $${GB.MAJOR},$${GB.MINOR},$${GB.MICRO},$${GB.BUILD}
+#define VER_FILE_STR \"$${GB.MAJOR}.$${GB.MINOR}.$${GB.MICRO}$${GB.PACKAGE_RELEASE}\"
+#define VER_PRODUCT_STR  \"$${GB.MAJOR}.$${GB.MINOR}.$${GB.MICRO}$${GB.PACKAGE_RELEASE}\"
+#else
+#define VERSION \"$${GB.MAJOR}.$${GB.MINOR}.$${GB.MICRO}$${GB.PACKAGE_RELEASE}\"
+#define WEB_DOC_DIR \"https://www.gpsbabel.org/htmldoc-$${DOCVERSION}\"
+#endif
old mode 100755 (executable)
new mode 100644 (file)
diff --git a/gui/setup.iss.qmake.in b/gui/setup.iss.qmake.in
new file mode 100644 (file)
index 0000000..5585a8d
--- /dev/null
@@ -0,0 +1,87 @@
+;\r
+; NOTE: setup.iss is generated from setup.iss.in via configure.\r
+; The generated setup.iss is checked in to help keep the version numbers\r
+; synchronized.\r
+;\r
+; Script for generating installation setup program for GPSBabel\r
+; Uses the Inno setup compiler.\r
+; windeployqt should be run to prepare the necessary Qt files before\r
+; running Inno Setup.\r
+#ifndef gui_build_dir_name\r
+  #define gui_build_dir_name \"build-app-Desktop_Qt_5_5_1_MinGW_32bit-Release\"\r
+#endif\r
+#ifndef gpsbabel_build_dir_name\r
+  #define gpsbabel_build_dir_name \"build-GPSBabel-Desktop_Qt_5_5_1_MinGW_32bit-Release\"\r
+#endif\r
+\r
+[Setup]\r
+; NOTE: The value of AppId uniquely identifies this application.\r
+; Do not use the same AppId value in installers for other applications.\r
+; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)\r
+AppId={{1B8FE958-A304-4902-BF7A-4E2F0F5B7017}\r
+AppName=GPSBabel\r
+AppVerName=GPSBabel $${VERSION}$${GB.PACKAGE_RELEASE}\r
+AppPublisher=GPSBabel\r
+AppPublisherURL=https://www.gpsbabel.org\r
+AppSupportURL=https://www.gpsbabel.org\r
+AppUpdatesURL=https://www.gpsbabel.org\r
+DefaultDirName={pf}\\GPSBabel\r
+DefaultGroupName=GPSBabel\r
+OutputDir=release\r
+OutputBaseFilename=GPSBabel-$${VERSION}$${GB.PACKAGE_RELEASE}-Setup\r
+OutputManifestFile=GPSBabel-$${VERSION}$${GB.PACKAGE_RELEASE}-Manifest.txt\r
+SetupIconFile=images\\babel2.ico\r
+Compression=lzma\r
+SolidCompression=yes\r
+LicenseFile=COPYING.txt\r
+\r
+[Languages]\r
+Name: \"english\"; MessagesFile: \"compiler:Default.isl\"\r
+\r
+[Tasks]\r
+Name: \"desktopicon\"; Description: \"{cm:CreateDesktopIcon}\"; GroupDescription: \"{cm:AdditionalIcons}\"; Flags: unchecked\r
+\r
+[Files]\r
+Source: gmapbase.html;                         DestDir: \"{app}\"; Flags: ignoreversion\r
+Source: qt.conf;                               DestDir: \"{app}\"; Flags: ignoreversion\r
+\r
+Source: \"..\\{#gui_build_dir_name}\\release\\*\"; Excludes: \"app.res,vcredist_*.exe,*.cpp,*.h,*.o,*.obj\"; DestDir: \"{app}\"; Flags: ignoreversion recursesubdirs createallsubdirs\r
+Source: \"..\\{#gui_build_dir_name}\\release\\vcredist_x86.exe\"; DestDir: \"{app}\"; Flags: ignoreversion skipifsourcedoesntexist deleteafterinstall\r
+Source: \"..\\{#gui_build_dir_name}\\release\\vcredist_x64.exe\"; DestDir: \"{app}\"; Flags: ignoreversion skipifsourcedoesntexist deleteafterinstall\r
+Source: \"..\\..\\{#gpsbabel_build_dir_name}\\release\\gpsbabel.exe\";         DestDir: \"{app}\"; Flags: ignoreversion\r
+; Source: release\\help\\*;            DestDir: \"{app}\\help\"; Flags: ignoreversion recursesubdirs createallsubdirs\r
+\r
+; Translation strings extracted from source code.  Include it in the dist\r
+; so that users can translate if they want to.\r
+; Source: gpsbabel_*.ts;               DestDir: \"{app}\\translations\"; Flags: ignoreversion\r
+; Source: gpsbabelfe_*.ts;             DestDir: \"{app}\\translations\"; Flags: ignoreversion\r
+\r
+; Compiled translation strings that are used at runtime.\r
+Source: coretool\\gpsbabel_*.qm;       DestDir: \"{app}\\translations\"; Flags: ignoreversion\r
+Source: gpsbabelfe_*.qm;               DestDir: \"{app}\\translations\"; Flags: ignoreversion\r
+\r
+; Miscellaneous\r
+Source: COPYING.txt;                   DestDir: {app}; Flags: ignoreversion\r
+; Source: AUTHORS;                     DestDir: {app}; Flags: ignoreversion\r
+; Source: README.contrib;                      DestDir: {app}; Flags: ignoreversion\r
+; Source: README.gui;                  DestDir: {app}; Flags: ignoreversion\r
+\r
+\r
+; NOTE: Don\'t use \"Flags: ignoreversion\" on any shared system files\r
+\r
+[Icons]\r
+Name: \"{group}\\GPSBabel\"; Filename: \"{app}\\gpsbabelfe.exe\"\r
+Name: \"{commondesktop}\\GPSBabel\"; Filename: \"{app}\\gpsbabelfe.exe\"; Tasks: desktopicon\r
+\r
+[Run]\r
+Filename: \"{app}\\vcredist_x86.exe\"; Parameters: \"/quiet\"; Flags: skipifdoesntexist\r
+Filename: \"{app}\\vcredist_x64.exe\"; Parameters: \"/quiet\"; Flags: skipifdoesntexist\r
+Filename: \"{app}\\gpsbabelfe.exe\"; Description: \"{cm:LaunchProgram,GPSBabelFE}\"; Flags: nowait postinstall skipifsilent\r
+\r
+[Registry]\r
+Root: HKCU; Subkey: \"Software\\GPSBabel\"; Flags: uninsdeletekeyifempty\r
+Root: HKCU; Subkey: \"Software\\GPSBabel\\GPSBabel\"; Flags: uninsdeletekey\r
+Root: HKCU; Subkey: \"Software\\GPSBabel\\GPSBabelFE\"; Flags: uninsdeletekey\r
+\r
+; ISPP preprocessor output can be useful for debug\r
+#expr SaveToFile(\"PreprocessedScript.iss\")\r
index c72d1d4c7c897d10bcf875da83b8a74a55d07250..4b10980dee2ea2000b74746fbe53f2a25544e75e 100755 (executable)
@@ -1,4 +1,4 @@
-#/bin/sh
+#!/bin/sh
 
 # set -e
 
 DIR=$1
 TITLE=$2
 
-SED=sed
+SED="sed"
 # MacOS using Homebrew
 [ -f /usr/local/bin/gsed ] && SED=/usr/local/bin/gsed
 [ -f /opt/local/bin/gsed ] && SED=/opt/local/bin/gsed
 
-[ ! -d $DIR/tpl ] && mkdir -p $DIR/tpl
+[ ! -d "$DIR/tpl" ] && mkdir -p "$DIR/tpl"
 
 
-for f in $DIR/*.html
+for f in "$DIR"/*.html
 do
-  base=$(echo $f | sed "s/.html$//")
+  base=$(echo "$f" | sed "s/.html$//")
   $SED -i \
   -e '/^<?xml/d' \
   -e '/^<!DOCTYPE head/d' \
@@ -29,9 +29,9 @@ do
   -e 's#<\/title>.*#{/block}#' \
   -e '/^<head/d' \
   -e 's#style="clear: both"##' \
-  $f
-  mv ${base}.html $(dirname $base)/tpl/$(basename $f .html).tpl
-  cat > ${base}.html  << EOF
+  "$f"
+  mv "${base}.html" "$(dirname "$base")/tpl/$(basename "$f" .html).tpl"
+  cat > "${base}.html"  << EOF
 <?php
 require("../lib/smarty_common.php");
 \$smarty->display(\$template);
diff --git a/tools/make_gpsbabel_html.sh b/tools/make_gpsbabel_html.sh
new file mode 100755 (executable)
index 0000000..4f4e664
--- /dev/null
@@ -0,0 +1,13 @@
+#!/bin/sh
+set -ex
+
+perl xmldoc/makedoc
+xsltproc \
+  --output gpsbabel.html \
+  --stringparam toc.section.depth "1" \
+  --stringparam html.cleanup "1" \
+  --stringparam make.clean.html "1" \
+  --stringparam html.valid.html "1" \
+  --stringparam html.stylesheet "https://www.gpsbabel.org/style3.css" \
+  http://docbook.sourceforge.net/release/xsl/current/xhtml/docbook.xsl \
+  xmldoc/readme.xml
diff --git a/tools/make_gpsbabel_org.sh b/tools/make_gpsbabel_org.sh
new file mode 100755 (executable)
index 0000000..f19b45c
--- /dev/null
@@ -0,0 +1,18 @@
+#!/bin/sh
+set -ex
+
+web=$1
+docversion=$2
+
+mkdir -p "${web}/htmldoc-${docversion}"
+perl xmldoc/makedoc
+xmlwf xmldoc/readme.xml #check for well-formedness
+xmllint --noout --valid xmldoc/readme.xml #validate
+xsltproc \
+  --stringparam base.dir "${web}/htmldoc-${docversion}/" \
+  --stringparam root.filename "index" \
+  xmldoc/babelmain.xsl \
+  xmldoc/readme.xml
+tools/fixdoc "${web}/htmldoc-${docversion}" "GPSBabel ${docversion}:"
+tools/mkcapabilities "${web}" "${web}/htmldoc-${docversion}"
+cp gpsbabel.pdf "${web}/htmldoc-${docversion}/gpsbabel-${docversion}.pdf"
diff --git a/tools/make_gpsbabel_pdf.sh b/tools/make_gpsbabel_pdf.sh
new file mode 100755 (executable)
index 0000000..e420c53
--- /dev/null
@@ -0,0 +1,8 @@
+#!/bin/sh
+set -ex
+
+perl xmldoc/makedoc
+xmlwf xmldoc/readme.xml #check for well-formedness
+xmllint --noout --valid xmldoc/readme.xml #validate
+xsltproc -o gpsbabel.fo xmldoc/babelpdf.xsl xmldoc/readme.xml
+HOME=. fop -q -fo gpsbabel.fo -pdf gpsbabel.pdf
index 63a20eb7b644a007bf6f22be170c6cb7237cee95..48351b93d8a2a1b02c2bc06fb6497b5530fedd6a 100755 (executable)
@@ -21,12 +21,12 @@ function getcap(type, cap, sname, lname) {
 }
 
 getcap($1, $2, $3, $5)
-' > ${capabilitiesdir}/capabilities.inc
+' > "${capabilitiesdir}/capabilities.inc"
 
-FMTS=`./gpsbabel -^2 | grep -v '^internal' | sed 's/\&/\&amp;/' | awk  -F'\t' '{print $3}'`
+FMTS=$(./gpsbabel -^2 | grep -v '^internal' | sed 's/\&/\&amp;/' | awk  -F'\t' '{print $3}')
 for f in $FMTS
 do
-       [ ! -f ${htmldocdir}/fmt_${f}.html ] && echo Missing doc for $f
+       [ ! -f "${htmldocdir}/fmt_${f}.html" ] && echo Missing doc for "$f"
 done
 
 exit 0
index eef83171a092412bceeedf5664e16665faf06527..925b6972a2800b89b8c8372ab00523f69e76d8f0 100755 (executable)
@@ -7,7 +7,7 @@
 # as of 3/16/2019 with coverage reporter 4.0.3 java 8 is not required.
 
 qmake
-make coverage
+make -j 3 coverage
 
 # debug tokens
 "$(cd "$(dirname "${BASH_SOURCE[0]}" )" && pwd)"/ci_tokens